function get_page_param(str)
{
	var LocString = String(window.document.location.href)
	var rs = new RegExp("(^|)" + str + "=([^&]*)(&|$)", "gi").exec(LocString), tmp
	if (tmp = rs) { 
		return tmp[2]
	}
	// parameter cannot be found 
	return ""
}

function pad0(num, n)
{
    var len = num.toString().length
    while(len < n) {
        num = "0" + num
        len++
    }
    return num
}

// author: meizz
function datetime_format(dt, fmt)
{
	var o = {
		"M+" : dt.getMonth()+1,                 //月份   
		"d+" : dt.getDate(),                    //日   
		"h+" : dt.getHours(),                   //小时   
		"m+" : dt.getMinutes(),                 //分   
		"s+" : dt.getSeconds(),                 //秒   
		"q+" : Math.floor((dt.getMonth()+3)/3) //季度   
	//	"S+" : dt.getMilliseconds()             //毫秒   
	};
	if(/(y+)/.test(fmt))
		fmt = fmt.replace(RegExp.$1, (dt.getFullYear()+"").substr(4 - RegExp.$1.length));
	for(var k in o)
		if(new RegExp("("+ k +")").test(fmt))
			fmt = fmt.replace(RegExp.$1, (RegExp.$1.length==1) ? (o[k]) : (("00"+ o[k]).substr((""+ o[k]).length)));
	if(new RegExp("("+ "S+" +")").test(fmt)) {
		var ms = dt.getMilliseconds()
		fmt = fmt.replace(RegExp.$1, (RegExp.$1.length==1) ? (ms) : (("000"+ ms).substr((""+ ms).length)));
	}
  	return fmt;
}

function getNowFormatDate() {
	var date = new Date();
	var seperator1 = "-";
	var seperator2 = ":";
	var month = date.getMonth() + 1;
	var strDate = date.getDate();
    if (month >= 1 && month <= 9) {
        month = "0" + month;
    }
    if (strDate >= 0 && strDate <= 9) {
        strDate = "0" + strDate;
    }
    var currentdate = date.getFullYear() + seperator1 + month + seperator1 + strDate
            + " " + date.getHours() + seperator2 + date.getMinutes()
            + seperator2 + date.getSeconds();
    return currentdate;
}

function ams_is_sim_mode()
{
	return 	true
}
